import { RigidBody } from "./RigidBody";
import { AnimationRenderer } from "../engine/AnimationRenderer";
import { TextRenderer } from "../engine/TextRenderer";
import { number } from "../engine/validators/number";
import { string } from "../engine/validators/string";
import { binding, Binding, makeBinding } from "./Binding";
import { Transform } from "../engine/Transform";



export class GhostAnimationBehaviour extends Binding {


    @string()
    @binding((prefabRoot, value) => {
        prefabRoot.children[0].getBehaviour(AnimationRenderer).source = value;
    })
    imageSource: string

    @string()
    @binding((prefabRoot, value) => {
        prefabRoot.children[0].getBehaviour(AnimationRenderer).source = value;
    })
    config: string

    @string()
    @binding((prefabRoot, value) => {
        prefabRoot.children[0].getBehaviour(AnimationRenderer).action = value;
    })
    action: string;

    constructor() {
        super();
        makeBinding(this)
    }
}